Skip to content

Conversation

@joshblack
Copy link
Member

@joshblack joshblack commented Nov 10, 2025

Closes https://github.com/github/primer/issues/5248

Changelog

New

  • Add the TopicTag component along with a helper TopicTag.Group component for layout

Changed

Removed

Rollout strategy

  • Minor release

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: 74b40ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 10, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot requested a deployment to storybook-preview-7177 November 10, 2025 18:22 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-7177 November 10, 2025 18:28 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7177 November 10, 2025 18:37 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-7177 November 10, 2025 19:48 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7177 November 10, 2025 19:57 Inactive
Copy link
Contributor

@lukasoppermann lukasoppermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design looks great. 👍

@joshblack joshblack marked this pull request as ready for review November 20, 2025 16:02
@joshblack joshblack requested a review from a team as a code owner November 20, 2025 16:02
Copilot AI review requested due to automatic review settings November 20, 2025 16:02
@joshblack joshblack requested a review from a team as a code owner November 20, 2025 16:02
@joshblack joshblack requested a review from langermank November 20, 2025 16:02
Copilot finished reviewing on behalf of joshblack November 20, 2025 16:03
@github-actions github-actions bot requested a deployment to storybook-preview-7177 November 20, 2025 16:04 Abandoned
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds a new TopicTag component and companion TopicTag.Group component to the Primer React design system. The TopicTag component renders clickable tags (defaulting to <a> elements) with support for button semantics via an as prop. The Group component provides a flex layout for displaying multiple tags with appropriate spacing.

The implementation includes comprehensive test coverage, Storybook stories, visual regression tests across multiple themes and viewports, and documentation metadata.

Reviewed Changes

Copilot reviewed 14 out of 44 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/react/src/TopicTag/TopicTag.tsx Main component implementation with polymorphic as prop support
packages/react/src/TopicTag/TopicTagGroup.tsx Helper component for laying out multiple tags
packages/react/src/TopicTag/index.ts Exports TopicTag with Group as a nested property
packages/react/src/TopicTag/TopicTag.module.css Styling for TopicTag with hover states and link reset
packages/react/src/TopicTag/TopicTagGroup.module.css Flexbox layout with gap spacing for tag groups
packages/react/src/TopicTag/TopicTag.test.tsx Unit tests for TopicTag component
packages/react/src/TopicTag/TopicTagGroup.test.tsx Unit tests for TopicTagGroup component
packages/react/src/TopicTag/TopicTag.stories.tsx Basic Storybook stories
packages/react/src/TopicTag/TopicTag.features.stories.tsx Feature demonstration stories
packages/react/src/TopicTag/TopicTag.docs.json Documentation metadata
e2e/components/TopicTag.test.ts Visual regression and accessibility tests
packages/react/src/experimental/index.ts Export TopicTag from experimental API
packages/react/src/tests/snapshots/exports.test.ts.snap Updated export snapshot
.changeset/three-wombats-invite.md Changeset for minor version release

</TopicTag>,
)

await userEvent.click(screen.getByRole('link', {name: 'test'}))
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test on line 27 is incorrect. When as="button" is used, the component should render a <button> element with role "button", not "link". The test should use screen.getByRole('button', {name: 'test'}) instead.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@hectahertz hectahertz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this, nice and clean ✨

color: var(--fgColor-onEmphasis);
}

/* Add a reset to when TopicTag is an <a> element since our link styles apply an underline text-decoration by default */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this explanation! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants